package com.yanqu.road.entity.activity.signindraw;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.activity.signindraw.config.SignInDrawDrawInfo;
import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.List;

public class SignInDrawConfig {

    private ActivityInfo activityInfo;

    private List<SignInDrawDrawInfo> drawInfoList;

    //许愿消耗道具
    private int MAKE_WISH_CONSUME;

    //补签消耗道具及数量
    private String SIGNATURE_CONSUME;

    //分享获得抽奖次数
    private int SHARING_REWARD;

    //每日签到领取抽奖次数
    private int SIGNIN_REWARD;

    //活跃限制
    private int ACTIVE_LIMIT;

    //公告条数
    private int ANNOUNCEMENT_QUANTITY;

    //用户区间（低价值用户|中价值用户|高价值用户）
    private String LOTTERY_VIP_LIMIT;

    //投放门客id
    private int PATRONS_ID;

    //门客转换道具
    private String PATRONS_TRANSFORM_ITEM;

    //道具转换
    private String GOODS_AUTO_CONSUME_TITLE;

    //亲爱的掌柜，您在{0}中，重复获得了{1}，现已为您转换为{2}x{3}。请查收！
    private String GOODS_AUTO_CONSUME_CONTENT;

    private int onlineTime;

    private int onlineReward;

    public int getValueType(long vipExp) {
        List<Long> valueList = StringUtils.stringToLongList(LOTTERY_VIP_LIMIT, "\\|");
        int type = 0;
        for (int i = 0; i < valueList.size(); i++) {
            if(vipExp >= valueList.get(i)){
                type = i;
            }
        }
        return type;
    }

    public List<SignInDrawDrawInfo> getSignInDrawDrawInfo(int day){
        List<SignInDrawDrawInfo> list = new ArrayList<>();
        for (SignInDrawDrawInfo drawInfo : drawInfoList) {
            if(drawInfo.getDay() == day){
                list.add(drawInfo);
            }
        }
        return list;
    }

    public SignInDrawDrawInfo getSignInDrawDrawInfoById(int rewardId){
        for (SignInDrawDrawInfo drawInfo : drawInfoList) {
            if(drawInfo.getRewardId() == rewardId){
                return drawInfo;
            }
        }
        return null;
    }

    public SignInDrawConfig(ActivityInfo activityInfo) {
        this.activityInfo = activityInfo;
    }

    public ActivityInfo getActivityInfo() {
        return activityInfo;
    }

    public void setActivityInfo(ActivityInfo activityInfo) {
        this.activityInfo = activityInfo;
    }

    public List<SignInDrawDrawInfo> getDrawInfoList() {
        return drawInfoList;
    }

    public void setDrawInfoList(List<SignInDrawDrawInfo> drawInfoList) {
        this.drawInfoList = drawInfoList;
    }

    public String getSIGNATURE_CONSUME() {
        return SIGNATURE_CONSUME;
    }

    public void setSIGNATURE_CONSUME(String SIGNATURE_CONSUME) {
        this.SIGNATURE_CONSUME = SIGNATURE_CONSUME;
    }

    public int getSHARING_REWARD() {
        return SHARING_REWARD;
    }

    public void setSHARING_REWARD(int SHARING_REWARD) {
        this.SHARING_REWARD = SHARING_REWARD;
    }

    public int getACTIVE_LIMIT() {
        return ACTIVE_LIMIT;
    }

    public void setACTIVE_LIMIT(int ACTIVE_LIMIT) {
        this.ACTIVE_LIMIT = ACTIVE_LIMIT;
    }

    public int getANNOUNCEMENT_QUANTITY() {
        return ANNOUNCEMENT_QUANTITY;
    }

    public void setANNOUNCEMENT_QUANTITY(int ANNOUNCEMENT_QUANTITY) {
        this.ANNOUNCEMENT_QUANTITY = ANNOUNCEMENT_QUANTITY;
    }

    public int getMAKE_WISH_CONSUME() {
        return MAKE_WISH_CONSUME;
    }

    public void setMAKE_WISH_CONSUME(int MAKE_WISH_CONSUME) {
        this.MAKE_WISH_CONSUME = MAKE_WISH_CONSUME;
    }

    public int getSIGNIN_REWARD() {
        return SIGNIN_REWARD;
    }

    public void setSIGNIN_REWARD(int SIGNIN_REWARD) {
        this.SIGNIN_REWARD = SIGNIN_REWARD;
    }

    public String getLOTTERY_VIP_LIMIT() {
        return LOTTERY_VIP_LIMIT;
    }

    public void setLOTTERY_VIP_LIMIT(String LOTTERY_VIP_LIMIT) {
        this.LOTTERY_VIP_LIMIT = LOTTERY_VIP_LIMIT;
    }

    public int getPATRONS_ID() {
        return PATRONS_ID;
    }

    public void setPATRONS_ID(int PATRONS_ID) {
        this.PATRONS_ID = PATRONS_ID;
    }

    public String getPATRONS_TRANSFORM_ITEM() {
        return PATRONS_TRANSFORM_ITEM;
    }

    public void setPATRONS_TRANSFORM_ITEM(String PATRONS_TRANSFORM_ITEM) {
        this.PATRONS_TRANSFORM_ITEM = PATRONS_TRANSFORM_ITEM;
    }

    public String getGOODS_AUTO_CONSUME_TITLE() {
        return GOODS_AUTO_CONSUME_TITLE;
    }

    public void setGOODS_AUTO_CONSUME_TITLE(String GOODS_AUTO_CONSUME_TITLE) {
        this.GOODS_AUTO_CONSUME_TITLE = GOODS_AUTO_CONSUME_TITLE;
    }

    public String getGOODS_AUTO_CONSUME_CONTENT() {
        return GOODS_AUTO_CONSUME_CONTENT;
    }

    public void setGOODS_AUTO_CONSUME_CONTENT(String GOODS_AUTO_CONSUME_CONTENT) {
        this.GOODS_AUTO_CONSUME_CONTENT = GOODS_AUTO_CONSUME_CONTENT;
    }

    public int getOnlineTime() {
        return onlineTime;
    }

    public void setOnlineTime(int onlineTime) {
        this.onlineTime = onlineTime;
    }

    public int getOnlineReward() {
        return onlineReward;
    }

    public void setOnlineReward(int onlineReward) {
        this.onlineReward = onlineReward;
    }
}
